<template>
    <div>
        <div class="list" @click.stop="goToCourseDetail()">
            <div class="left">
                <img :src="item.thumb" alt="" />
            </div>
            <div class="right">
                <div class="one">{{ item.title }}</div>
                <div class="tow">
                    <p>{{ item.user_count }}人已订阅</p>
                    <p v-if="item.charge > 0"><span>￥</span>{{ item.charge }}</p>
                    <p v-else class="charge">免费</p>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props: ["item"],
    methods: {
        goToCourseDetail: function () {
            this.$router.push({
                path: "/vod/detail",
                query: {
                    id: this.item.id,
                },
            });
        },
    },
};
</script>

<style lang="less" scoped>
.list {
    width: 100%;
    display: flex;
    margin-bottom: 15px;
    .left {
        width: 120px;
        height: 90px;
        margin-right: 10px;
        img {
            width: 100%;
            height: 100%;
            border-radius: 5px;
        }
    }
    .right {
        flex: 1;
        display: flex;
        flex-wrap: wrap;
        padding-top: 5px;
        .one {
            width: 100%;
            height: 40px;
            font-size: 15px;
            margin-bottom: 15px;
            line-height: 20px;
            font-weight: 500;
        }
        .tow {
            width: 100%;
            display: flex;
            align-items: center;
            p {
                flex: 1;
                height: auto;
            }
            p:nth-child(1) {
                font-size: 12px;
                color: #999;
            }
            p:nth-child(2) {
                text-align: right;
                font-size: 18px;
                line-height: 18px;
                font-weight: 600;
                color: #ff5858;
                &.charge {
                    color: #52c41a;
                }
                span {
                    font-size: 14px;
                }
            }
        }
    }
}
</style>
